package com.pq.aop;


import com.pq.vo.SysResult;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

@RestControllerAdvice//aop+异常通知
public class SystemException {
    @ExceptionHandler(RuntimeException.class)
    public SysResult exception(Exception e){
        //如果出错，返回系统级别的报错数据
        e.printStackTrace();
        return SysResult.fail();
    }
}
